package lambda.examples._05;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

public class App {
	public static void main(String args[]) {

		List<String> languages = Arrays.asList("Java", "Scala", "C++", "Haskell", "Lisp");

		Predicate<String> startsWithJ = (n) -> n.startsWith("J");
		Predicate<String> fourLetterLong = (n) -> n.length() == 4;

		languages.stream().filter(startsWithJ.and(fourLetterLong)).forEach(System.out::println);

	}

}
